# Simulations for Markov Blanket Dynamics in Neural Systems

## Overview

This repository contains the simulation datasets and supporting files for the appendix document titled "Appendix: Simulations for Markov Blanket Dynamics and Active Inference in Neural Systems," which accompanies the main paper "Max, A., 2025" (DOI: https://doi.org/10.2139/ssrn.5156247). The simulations validate the conjectures presented in the Appendix A sections on Lemmas (I.A to I.F) and Theorems (II.A to II.C), focusing on the emergence, stability, and dynamics of attractors and Markov blankets in neural systems under a novel framework. The dataset include raw outputs, processed results, enabling replication of the findings, exploration of additional parameter regimes, and extension to related neurocomputational models.

## Repository Contents

- **Simulation Data Files**:
  - Files are named according to the appendix section names:
    - `I.A.py`, `I.B.py`, ..., `I.F.py`: Simulation outputs for Lemmas (Section I).
    - `II.A.py`, `II.B.py`, `II.C.py`: Simulation outputs for Theorems (Section II).
  - Each file outputs raw simulation results.

- **LICENSE.txt**:
  - This file specifies the licensing terms for the use and distribution of the datasets. The data is licensed under the CC BY 4.0 license. Please review the license before using the data.

- **env_requirements.txt**:
  - This file lists the dependencies required to replicate the simulations. It is formatted for use with Conda to set up a Python environment. To install the dependencies, run the following commands:

conda create -n M3E_simulations python=3.11.5
conda activate M3E_simulations
conda install --file env_requirements.txt

- The environment includes packages such as NumPy, SciPy, Matplotlib, and others necessary for running the simulation scripts and replicating the data.

## Usage Instructions

1. **Accessing the Data**:
- Download the files from this repository (https://doi.org/10.7910/DVN/PRC3RS).

2. **Setting Up the Environment**:
- Install Conda if not already installed (see https://docs.conda.io/en/latest/miniconda.html).
- Use the `env_requirements.txt` file to set up the Conda environment as described above.
- Activate the environment before running any analysis scripts.

3. **Replicating the Results**:
- Refer to the appendix document for details on the simulation and theoretical assumptions.
- Use the python files (e.g., `I.C.py` for Lemma I.C, `II.C.py` for Theorem II.C) to replicate the figures and statistical analyses presented in the appendix.

4. **Extending the Simulations**:
- The executable scripts can be used to explore additional parameter regimes (e.g., varying noise levels, initial conditions) or to extend the framework to related models.
- Plot scripts (if provided) can be modified to generate new figures or metrics.

## Citation

If you use this dataset in your research, please cite the following:

- Appendix: "Appendix A: Mathematical Foundations of M3E," [Max, A., 2025], https://doi.org/10.17605/OSF.IO/79TDG.
- Main Paper: Max, A. (2025). Mind, Motion and Multiscale Emergence: Exploring the Thermodynamics of Cognitive Experiences. Available at SSRN 5156247 | https://doi.org/10.2139/ssrn.5156247.
- Dataset: "Replication Data for: Appendix A – Mathematical Foundations of M3E," Harvard Dataverse, https://doi.org/10.7910/DVN/PRC3RS.

## Contact

For questions about the dataset or simulations, please contact antoniomaxai@gmail.com.

## Acknowledgments

I thank the Harvard Dataverse team for hosting this repository.